package com.ye.feign;

import com.ye.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("mould-db")
public interface UserFeign {
    @GetMapping("/all")
    public List<User> queryAll();
    @GetMapping("queryById")
    public User queryUserById(@RequestParam("id") Integer id);
    @GetMapping("updatePassword")
    public void updatePassword(@RequestParam("username") String username,@RequestParam("password") String password);
    @GetMapping("/updateState")
    public void updateState(@RequestParam("id") Integer id,@RequestParam("state") String state);
    @PostMapping (value = "/insertUser")
    public void insertUser(@RequestBody User user);
    @PostMapping("/login")
    public User loginAuth(@RequestParam("username") String username,@RequestParam("password") String password);

}
